function foo(num){
    switch(num){
        case 1:
            console.log("周一");
            break;
        case 2:
            console.log("周二");
            break;
        case 3:
            console.log("周三");
            break;
        case 4:
            console.log("周四");
            break;
        case 5:
            console.log("周五");
            break;
        case 6:
            console.log("周六");
            break;
        case 7 :
            console.log("周日");
            break;

        default:
            console.log("请输入合法字符");

    }

}

foo(8)
